package com.pattern.demo;

import com.pattern.demo.abstracts.Duck;
import com.pattern.demo.behavior.fly.FlyWithWings;
import com.pattern.demo.behavior.quack.Quack;

/**
 * @ClassName: MallardDuck  野鸭子类，具有呱呱叫和飞行能力
 * @Description:
 * @Date: 2020/8/26 14:21
 * @Author: Song JinGen
 */
public class MallardDuck extends Duck {

    /**
     * 无参构造方法
     */
    public MallardDuck(){
        quackBehavior = new Quack();
        flyBehavior = new FlyWithWings();
        System.out.println("无参构造方法执行");
    }

    @Override
    public void display() {
        System.out.println("我是一只野鸭子");
    }
}
